package edu.whu.puppygo.service.Impl;

import edu.whu.puppygo.config.RabbitmqConfig;
import edu.whu.puppygo.service.RabbitmqService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author guanruwang
 * @date 2023/9/26$
 */

@Service
@Slf4j
public class RabbitmqServiceImpl implements RabbitmqService {
    @Resource
    RabbitTemplate rabbitTemplate;


    @Override
    public boolean sendMsg(String msg) {

        rabbitTemplate.convertAndSend(RabbitmqConfig.DIRECT_EXCHANGE, "task_queue", msg);
        return true;
    }

}
